<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
    <h:head>
       
    </h:head>
    <h:body>
        <ui:composition template="../../admin/adminTemplate.xhtml">
            <ui:define name="page">
                <h1>Visa lunchrätter</h1>
                <p>Obs! Rätter som är beställda kan inte tas bort!</p>
                
                <h:dataTable class="form" value="#{listLunch.lunches}" var="c"
                            styleClass="order-table"
                            headerClass="order-table-header"
                            rowClasses="order-table-odd-row,order-table-even-row">
                    
                    <h:column>
                        <f:facet name="header">
                            Namn på rätt
                        </f:facet>
                        #{c.lunchName}
                    </h:column>
                    
                    <h:column>
                        <f:facet name="header">
                            Beskrivning
                        </f:facet>
                        #{c.lunchDescription}
                    </h:column>
                    
                    <h:column>
                        <f:facet name="header">
                            Pris
                        </f:facet>
                        #{c.lunchPrice}
                    </h:column>
                    
                    <h:column>
                        <f:facet name="header">
                            Åtgärd
                        </f:facet>
                        
                        <h:form>
                            <h:commandButton value="Ta Bort" action="#{listLunch.destroy(c.lunchName)}"/>
                            <h:commandButton value="Redigera" action="#{listLunch.prepareUpdate(c.lunchName, c.lunchDescription, c.lunchPrice)}"/>
                        </h:form>
                    </h:column>
                </h:dataTable>
            </ui:define>
        </ui:composition>
    </h:body>
</html>

